20 PRINT" (This formula is especially valuable in evaluating the prior probability":PRINT " of disease given a certain symptom, sign or laboratory result.)"
40 PRINT: PRINT: PRINT "Do you want to evaluate the: ": PRINT
50 PRINT TAB(8);"1.) Probabilities of False Positive and False Negative tests": PRINT
60 PRINT TAB(8);"2.) Probabilities of Disease given a Positive test": PRINT: PRINT
70 PRINT TAB(20);: INPUT "Enter choice: ",ASUB: IF ABS(1.5-ASUB)>0.51 THEN BEEP: GOTO 70
80 CLS: ON ASUB GOTO 85,200
85 PRINT TAB(10);"PROBABILITIES OF FALSE POSITIVE AND FALSE NEGATIVE TESTS": PRINT TAB(10);STRING$(56,205): PRINT
90 PRINT TAB(5); "What is the probability of a POSITIVE test": PRINT TAB(33);: INPUT "when a person has this disease? ",PT
180 PRINT TAB(10);"The probability of a FALSE POSITIVE result is ";PP;TAB(79)
185 COLOR 7,0: PRINT :PRINT : COLOR 0,7
190 PRINT TAB(10);"The probability of a FALSE NEGATIVE result is ";PN;TAB(79)
195 COLOR 7,0: GOTO 340
200 PRINT TAB(15);"PROBABILITIES OF DISEASE GIVEN A POSITIVE TEST": PRINT TAB(15);STRING$(46,205): PRINT
205 PRINT TAB(5); "What is the name of the SYMPTOM COMPLEX, PHYSICAL FINDING,": PRINT TAB(25);:INPUT "or LABORATORY TEST under consideration? ",T$
210 PRINT TAB(5); "In the tested population, HOW MANY DISEASES exist ": PRINT TAB(29);:INPUT "in which this test can be positive? ",N: PRINT
220 ERASE PT,PD,D$: DIM PT(N),PD(N),D$(N): TF=0
230 PRINT TAB(15);" PERCENT of people PROBABILITY of a "
240 PRINT TAB(15);" in tested population + test in people"
250 PRINT TAB(15);"who have this disease: known to have"
260 PRINT TAB(3);"DISEASE (SUM must = 100%) this disease:": PRINT
270 FOR Z=1 TO N: PRINT "#";Z;:IF TF=1 THEN PRINT D$(Z); ELSE INPUT;"",D$(Z)
275 PRINT TAB(24);:INPUT;"",P:PD(Z)=P*0.01:PRINT TAB(46);:INPUT "",PT(Z):NEXT Z
280 SP=0: FOR Z=1 TO N: SP=SP+PD(Z)*PT(Z): NEXT
290 LOCATE 9,60: COLOR 0,7: PRINT " PROBABILITY of ":LOCATE 10,60:PRINT " this disease in ": LOCATE 11,60:PRINT " a person with a ":LOCATE 12,60:PRINT " positive test: "
300 FOR Z=1 TO N: LOCATE 13+Z,66: PRINT USING ".######";PD(Z)*PT(Z)/SP: NEXT
305 PLAY "MB MS O2 T200 L32 DF#AF#DF#AF#DF# L2 D"
310 COLOR 7,0: PRINT: PRINT TAB(10);
320 PRINT "Would you like to modify these calculations in relation to"
325 PRINT TAB(15);:INPUT "the SAME TEST and the SAME DISEASES? (Y or N) ",A$
330 IF A$="y" OR A$="Y" THEN TF=1: CLS: LOCATE 4,30: PRINT "TEST = ";T$: LOCATE 9,1: GOTO 230
340 PRINT: PRINT: PRINT: PRINT TAB(8);
350 INPUT "Do you want another calculation using Bayes' Theorem? (Y or N) ",A$
360 IF A$="Y" OR A$="y" THEN 15
370 END
380 BEEP: PRINT TAB(15);"Probability should be a fraction between 0 and 1.": PRINT: RETURN